import type { ConditionQuery } from '@/apis/model/waf'
import { getApiWafConditionQueryApi } from '@/apis/modules/waf'
import { defineStore } from 'pinia'

export const useConfigStore = defineStore(
  storesKey.config,
  () => {
    const conditionQuery = ref<ConditionQuery>()

    function getCondition(params?: any) {
      getApiWafConditionQueryApi({ ...params }).then((res) => {
        conditionQuery.value = res
      })
    }
    return { conditionQuery, getCondition }
  },
  {
    persist: true
  }
)
